<template>
  <!-- 模板内容：只能有一个div  -->
  <div>
    <div class="box">
      <h2>流行菜单</h2>
      <div v-for="(item, index) in list" :key="index">
        <div>
          <img :src="item.img" alt="" />
        </div>
        <div>
          <h3>{{ item.aaa }}</h3>
        </div>
      </div>
    </div>
    <div class="box">
      <h2>下厨房的厨友们</h2>
      <div class="big">
        <div class="big-list" v-for="(item,index) in listill" :key="index">
          <img
            :src="item.img"
            alt=""
          />
          <div class="big-con">
            <p class="p1">{{item.speak1}}</p>
            <p>{{item.speak2}}</p>
            <p>{{item.speak3}}</p>
          </div>
          <div class="gz"><a href="">{{item.guan}}</a></div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import axios from "axios";

export default {
  name: "app",
  data() {
    return {
      list: [],
      listill:[]
    };
  },
  methods: {
    async fn_a() {
      let { data } = await axios.get(
        "https://mock.presstime.cn/mock/61bbe55090bfb20016179195/broducttest/shoppingcard"
      );
      this.list = data.content_menu_icon;
      this.listill = data.content_menulitem;
      console.log(data.content_menu_icon);
    },
  },
  created() {
    this.fn_a();
  },
};
</script>

<style lang="less" scoped>
/* css样式 */
.box {
  width: 300px;
  //   height: 300px;
//   background: olivedrab;
  margin: 0 auto;

  h2 {
    margin: 10px;
    font-size: 20px;
    color: #c0ae7d;
    display: inline-block;
  }
  h3 {
    margin: 10px;
    font-size: 16px;
    text-align: center;
    font-weight: normal;
    padding: 10px;
  }
  .big-list {
    width: 100%;
    height: 60px;
    padding: 10px;
    margin: 5px;
    img {
      width: 60px;
      height: 60px;
      border-radius: 50%;
      float: left;
    }
    .big-con {
      margin: 0px 8px;
      float: left;
      text-align: center;
      .p1 {
        font-size: 14px;
      }
      p {
        font-size: 12px;
      }
    }
    .gz {
      width: 86px;
      height: 40px;
      float: left;
      margin-top: 10px;
      margin-left: 10px;
      background: #dd3915;
      text-align: center;
      line-height: 40px;
      a {
        color: #fff;
      }
    }
  }
}
</style>